<html>
<head><meta charset="utf-8"><title>Type library · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html">Type library</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="207036142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036142">(Aug 15 2020 at 19:44)</a>:</h4>
<p>Nice summary for the state of things, <span class="user-mention" data-user-id="232957">@Jack Huey</span> . I've been wanting to get into the rustc side of things more, let me see if I can help things advance by starting the <code>ty.kind(tcx)</code> step in the type library part, now that the <code>ty.kind()</code> step is almost done</p>



<a name="207036193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036193">(Aug 15 2020 at 19:45)</a>:</h4>
<p>Yeah, <code>ty.kind(tcx)</code> would be a good place to start/continue</p>



<a name="207036246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036246">(Aug 15 2020 at 19:46)</a>:</h4>
<p>perf looked fine on the <code>ty.kind()</code> PR, so I think it's probably just waiting on a review from <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="207036266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036266">(Aug 15 2020 at 19:46)</a>:</h4>
<p>It’s also waiting on the MCP being accepted</p>



<a name="207036267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036267">(Aug 15 2020 at 19:46)</a>:</h4>
<p>(well, it says waiting on fcp for the mcp, but it's been like 8 days since a second)</p>



<a name="207036283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036283">(Aug 15 2020 at 19:47)</a>:</h4>
<p>FCP lasts 10 days IIRC</p>



<a name="207036290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036290">(Aug 15 2020 at 19:47)</a>:</h4>
<p>yeah, so tomorrow</p>



<a name="207036298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036298">(Aug 15 2020 at 19:47)</a>:</h4>
<p>Niko won't get to the review until Monday at least</p>



<a name="207036337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036337">(Aug 15 2020 at 19:48)</a>:</h4>
<p>Not expecting trouble there, since there was a compiler design meeting about that</p>



<a name="207036347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036347">(Aug 15 2020 at 19:48)</a>:</h4>
<p>Though we'll see how much bikeshedding is still needed on the later steps</p>



<a name="207036355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036355">(Aug 15 2020 at 19:48)</a>:</h4>
<p>Right, I don't think anyone is going to be particularly troubled by these changes</p>



<a name="207036503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036503">(Aug 15 2020 at 19:53)</a>:</h4>
<p>One thing that we will have to think about is the <code>TypeFlags</code></p>



<a name="207036512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036512">(Aug 15 2020 at 19:53)</a>:</h4>
<p>And where that would fit into chalk's idea of <code>Ty</code></p>



<a name="207036583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036583">(Aug 15 2020 at 19:54)</a>:</h4>
<p>(and to some extent the <code>outer_exclusive_binder</code>)</p>



<a name="207036752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207036752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207036752">(Aug 15 2020 at 19:58)</a>:</h4>
<p>I guess <code>InternedType</code> would be <code>&amp;'tcx TyS&lt;'tcx&gt;</code> and <code>ty_data</code> would return <code>ty.kind(self.tcx)</code></p>



<a name="207037298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207037298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207037298">(Aug 15 2020 at 20:12)</a>:</h4>
<p>(moving messages to new topic)</p>



<a name="207037488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207037488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207037488">(Aug 15 2020 at 20:17)</a>:</h4>
<p>One downside of changing <code>kind()</code> to <code>kind(tcx)</code> while leaving the interner for a later PR is that things like <code>impl Ord for TyS</code> become tricky</p>



<a name="207037769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207037769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207037769">(Aug 15 2020 at 20:25)</a>:</h4>
<p>We need <code>Ord</code> for <code>TyS</code>?</p>



<a name="207037818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207037818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207037818">(Aug 15 2020 at 20:26)</a>:</h4>
<p>rustc might use it, and that's something that could be added to the associated type bound later if it turns out to be needed</p>



<a name="207037897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207037897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207037897">(Aug 15 2020 at 20:28)</a>:</h4>
<p>Lots of structs that hold a type also derive Ord</p>



<a name="207037925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207037925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207037925">(Aug 15 2020 at 20:29)</a>:</h4>
<p>But this is just the same problem that we had with passing the interner everywhere in chalk</p>



<a name="207040000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207040000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207040000">(Aug 15 2020 at 21:23)</a>:</h4>
<p>I was asking some questions too in <a href="#narrow/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan">this topic</a></p>



<a name="207080220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207080220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207080220">(Aug 16 2020 at 17:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125131">detrumi</span> <a href="#narrow/stream/144729-wg-traits/topic/Type.20library/near/207037488">said</a>:</p>
<blockquote>
<p>One downside of changing <code>kind()</code> to <code>kind(tcx)</code> while leaving the interner for a later PR is that things like <code>impl Ord for TyS</code> become tricky</p>
</blockquote>
<p>This is also what I was thinking when I first tried to get my hands on this task, but I'm thinking that for now we could directly use the <code>kind</code> field instead</p>



<a name="207080918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207080918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207080918">(Aug 16 2020 at 17:46)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> That would require <code>TyS.kind</code> to be public again, but yeah, that's a way to do it</p>



<a name="207080932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207080932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207080932">(Aug 16 2020 at 17:47)</a>:</h4>
<p>I mean, we can do that in the meantime</p>



<a name="207080980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207080980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207080980">(Aug 16 2020 at 17:48)</a>:</h4>
<p>Though I’m not sure to understand what the "final product" will look like</p>



<a name="207080992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207080992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207080992">(Aug 16 2020 at 17:48)</a>:</h4>
<p>It would be quite similar to how it's now done in chalk, I think</p>



<a name="207081075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207081075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207081075">(Aug 16 2020 at 17:50)</a>:</h4>
<p>When using associated types on the interner, <code>Ord</code> is not a problem because you can specify it as a bound on the associated type</p>



<a name="207081297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207081297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207081297">(Aug 16 2020 at 17:54)</a>:</h4>
<p>And setups like <code>TypeVisitor</code> would need to thread the interner through in some way as well</p>



<a name="207081517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207081517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207081517">(Aug 16 2020 at 17:58)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> The examples in the <a href="https://rust-lang.github.io/compiler-team/minutes/design-meeting/2020-03-12-shared-library-for-types/">meeting notes</a> goes most of the way in showing what the end result would look like, wouldn't it?</p>



<a name="207082082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082082">(Aug 16 2020 at 18:07)</a>:</h4>
<p>Yes, but I had some questions like "what would the <code>outer_exclusive_binder</code>field become?"</p>



<a name="207082183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082183">(Aug 16 2020 at 18:08)</a>:</h4>
<p>My understanding is that we'd keep the <code>TyS</code> struct and intern that, but hide it as an implementation detail of <code>rustc</code>. Is that right?</p>



<a name="207082203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082203">(Aug 16 2020 at 18:09)</a>:</h4>
<p>Yes</p>



<a name="207082251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082251">(Aug 16 2020 at 18:09)</a>:</h4>
<p>Can't the <code>outer_exclusive_binder</code> field be bundled with the flags?</p>



<a name="207082300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082300">(Aug 16 2020 at 18:10)</a>:</h4>
<p>Like the <code>FlagComputation</code> struct right now</p>



<a name="207082410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082410">(Aug 16 2020 at 18:13)</a>:</h4>
<p>I'm not sure on the details of those fields, but I'm assuming that from the type lib's point of view, everything is split between the data and everything else (flags)</p>



<a name="207082590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082590">(Aug 16 2020 at 18:14)</a>:</h4>
<p>Side note: if you want to do the <code>ty.kind() -&gt; ty.kind(tcx)</code>, I wanted to propose my help</p>



<a name="207082672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082672">(Aug 16 2020 at 18:16)</a>:</h4>
<p>You mean work together on the same branch? Or just reviewing? (hope I'm also not "stealing" this task from you)</p>



<a name="207082683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082683">(Aug 16 2020 at 18:17)</a>:</h4>
<p>But yeah, great</p>



<a name="207082687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082687">(Aug 16 2020 at 18:17)</a>:</h4>
<p>It's going to be a boring task, so I thought working together on the same would be a good idea</p>



<a name="207082737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207082737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207082737">(Aug 16 2020 at 18:18)</a>:</h4>
<p>And no you're not stealing anything, I'm not here because of <a href="http://thanks.rust-lang.org">thanks.rust-lang.org</a> x)</p>



<a name="207083360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207083360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207083360">(Aug 16 2020 at 18:37)</a>:</h4>
<p>Hmm, I suppose that in some cases, needing to pass the <code>TyCtxt</code> allows some other refactors, like here:</p>
<div class="codehilite"><pre><span></span><code>needs_drop_components(self, &amp;tcx.data_layout, tcx)
</code></pre></div>



<a name="207083613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207083613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207083613">(Aug 16 2020 at 18:45)</a>:</h4>
<p>Started a branch on top of your <code>ty.kind()</code> branch: <a href="https://github.com/rust-lang/rust/compare/master...detrumi:tcx-in-ty-kind">https://github.com/rust-lang/rust/compare/master...detrumi:tcx-in-ty-kind</a></p>



<a name="207083867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207083867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207083867">(Aug 16 2020 at 18:53)</a>:</h4>
<p>The <code>TypeFolder</code> trait already has a <code>tcx()</code> method, not sure if <code>TypeVisitor</code> needs one as well. Might be easier to just add <code>tcx</code> parameters to the 4 trait functions instead. But then <code>TypeFoldable</code> also starts needing it...</p>



<a name="207084121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207084121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207084121">(Aug 16 2020 at 18:57)</a>:</h4>
<p>Oh that's funny, there's already a <code>HasTyCtxt</code> trait in rustc, but it's specific to <code>ty/layout.rs</code></p>



<a name="207084245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207084245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207084245">(Aug 16 2020 at 18:59)</a>:</h4>
<p>I'll hold off on generalizing that for now to avoid possible performance impacts of generics, though maybe we'll need it at some point</p>



<a name="207086871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207086871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207086871">(Aug 16 2020 at 19:56)</a>:</h4>
<p>Alright, that's most of the trivial cases. Going off the remaining errors, there's a few categories left:</p>
<ul>
<li>PartialEq, Hash and Borrow impls for <code>TyKind</code>, Ord impl for TyS</li>
<li>Some <code>Display</code> impls</li>
<li><code>TypeVisitor</code> and <code>TypeFoldable</code></li>
<li>Some places that don't have a <code>TyCtxt</code> around<br>
(and probably some cases I missed <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span> )</li>
</ul>



<a name="207087136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Type%20library/near/207087136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Type.20library.html#207087136">(Aug 16 2020 at 20:01)</a>:</h4>
<p>Okay, most trivial cases in librustc_middle. I see there's also a lot of calls in codegen/mir/clippy and others I haven't checked yet</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>